<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html 
     PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <title>Class: Commands::Update</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
  <meta http-equiv="Content-Script-Type" content="text/javascript" />
  <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
  <script type="text/javascript">
  // <![CDATA[

  function popupCode( url ) {
    window.open(url, "Code", "resizable=yes,scrollbars=yes,toolbar=no,status=no,height=150,width=400")
  }

  function toggleCode( id ) {
    if ( document.getElementById )
      elem = document.getElementById( id );
    else if ( document.all )
      elem = eval( "document.all." + id );
    else
      return false;

    elemStyle = elem.style;
    
    if ( elemStyle.display != "block" ) {
      elemStyle.display = "block"
    } else {
      elemStyle.display = "none"
    }

    return true;
  }
  
  // Make codeblocks hidden by default
  document.writeln( "<style type=\"text/css\">div.method-source-code { display: none }</style>" )
  
  // ]]>
  </script>

</head>
<body>



    <div id="classHeader">
        <table class="header-table">
        <tr class="top-aligned-row">
          <td><strong>Class</strong></td>
          <td class="class-name-in-header">Commands::Update</td>
        </tr>
        <tr class="top-aligned-row">
            <td><strong>In:</strong></td>
            <td>
                <a href="../../files/vendor/rails/railties/lib/commands/plugin_rb.html">
                vendor/rails/railties/lib/commands/plugin.rb
                </a>
        <br />
            </td>
        </tr>

        <tr class="top-aligned-row">
            <td><strong>Parent:</strong></td>
            <td>
                <a href="../Object.html">
                Object
               </a>
            </td>
        </tr>
        </table>
    </div>
  <!-- banner header -->

  <div id="bodyContent">



  <div id="contextContent">



   </div>

    <div id="method-list">
      <h3 class="section-bar">Methods</h3>

      <div class="name-list">
      <a href="#M000509">new</a>&nbsp;&nbsp;
      <a href="#M000510">options</a>&nbsp;&nbsp;
      <a href="#M000511">parse!</a>&nbsp;&nbsp;
      </div>
    </div>

  </div>


    <!-- if includes -->

    <div id="section">





      


    <!-- if method_list -->
    <div id="methods">
      <h3 class="section-bar">Public Class methods</h3>

      <div id="method-M000509" class="method-detail">
        <a name="M000509"></a>

        <div class="method-heading">
          <a href="#M000509" class="method-signature">
          <span class="method-name">new</span><span class="method-args">(base_command)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000509-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000509-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/railties/lib/commands/plugin.rb, line 777</span>
777:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">base_command</span>)
778:       <span class="ruby-ivar">@base_command</span> = <span class="ruby-identifier">base_command</span>
779:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <h3 class="section-bar">Public Instance methods</h3>

      <div id="method-M000510" class="method-detail">
        <a name="M000510"></a>

        <div class="method-heading">
          <a href="#M000510" class="method-signature">
          <span class="method-name">options</span><span class="method-args">()</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000510-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000510-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/railties/lib/commands/plugin.rb, line 781</span>
781:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">options</span>
782:       <span class="ruby-constant">OptionParser</span>.<span class="ruby-identifier">new</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">o</span><span class="ruby-operator">|</span>
783:         <span class="ruby-identifier">o</span>.<span class="ruby-identifier">set_summary_indent</span>(<span class="ruby-value str">'  '</span>)
784:         <span class="ruby-identifier">o</span>.<span class="ruby-identifier">banner</span> =    <span class="ruby-node">&quot;Usage: #{@base_command.script_name} update [name [name]...]&quot;</span>
785:         <span class="ruby-identifier">o</span>.<span class="ruby-identifier">on</span>(         <span class="ruby-value str">&quot;-r REVISION&quot;</span>, <span class="ruby-value str">&quot;--revision REVISION&quot;</span>,
786:                       <span class="ruby-value str">&quot;Checks out the given revision from subversion.&quot;</span>,
787:                       <span class="ruby-value str">&quot;Ignored if subversion is not used.&quot;</span>) { <span class="ruby-operator">|</span><span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-ivar">@revision</span> = <span class="ruby-identifier">v</span> }
788:         <span class="ruby-identifier">o</span>.<span class="ruby-identifier">define_head</span> <span class="ruby-value str">&quot;Update plugins.&quot;</span>
789:       <span class="ruby-keyword kw">end</span>
790:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>

      <div id="method-M000511" class="method-detail">
        <a name="M000511"></a>

        <div class="method-heading">
          <a href="#M000511" class="method-signature">
          <span class="method-name">parse!</span><span class="method-args">(args)</span>
          </a>
        </div>
      
        <div class="method-description">
          <p><a class="source-toggle" href="#"
            onclick="toggleCode('M000511-source');return false;">[Source]</a></p>
          <div class="method-source-code" id="M000511-source">
<pre>
     <span class="ruby-comment cmt"># File vendor/rails/railties/lib/commands/plugin.rb, line 792</span>
792:     <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse!</span>(<span class="ruby-identifier">args</span>)
793:       <span class="ruby-identifier">options</span>.<span class="ruby-identifier">parse!</span>(<span class="ruby-identifier">args</span>)
794:       <span class="ruby-identifier">root</span> = <span class="ruby-ivar">@base_command</span>.<span class="ruby-identifier">environment</span>.<span class="ruby-identifier">root</span>
795:       <span class="ruby-identifier">cd</span> <span class="ruby-identifier">root</span>
796:       <span class="ruby-identifier">args</span> = <span class="ruby-constant">Dir</span>[<span class="ruby-value str">&quot;vendor/plugins/*&quot;</span>].<span class="ruby-identifier">map</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">f</span><span class="ruby-operator">|</span>
797:         <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-node">&quot;#{f}/.svn&quot;</span>) <span class="ruby-operator">?</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">basename</span>(<span class="ruby-identifier">f</span>) <span class="ruby-operator">:</span> <span class="ruby-keyword kw">nil</span>
798:       <span class="ruby-keyword kw">end</span>.<span class="ruby-identifier">compact</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">args</span>.<span class="ruby-identifier">empty?</span>
799:       <span class="ruby-identifier">cd</span> <span class="ruby-value str">&quot;vendor/plugins&quot;</span>
800:       <span class="ruby-identifier">args</span>.<span class="ruby-identifier">each</span> <span class="ruby-keyword kw">do</span> <span class="ruby-operator">|</span><span class="ruby-identifier">name</span><span class="ruby-operator">|</span>
801:         <span class="ruby-keyword kw">if</span> <span class="ruby-constant">File</span>.<span class="ruby-identifier">directory?</span>(<span class="ruby-identifier">name</span>)
802:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Updating plugin: #{name}&quot;</span>
803:           <span class="ruby-identifier">system</span>(<span class="ruby-node">&quot;svn #{$verbose ? '' : '-q'} up \&quot;#{name}\&quot; #{@revision ? &quot;-r #{@revision}&quot; : ''}&quot;</span>)
804:         <span class="ruby-keyword kw">else</span>
805:           <span class="ruby-identifier">puts</span> <span class="ruby-node">&quot;Plugin doesn't exist: #{name}&quot;</span>
806:         <span class="ruby-keyword kw">end</span>
807:       <span class="ruby-keyword kw">end</span>
808:     <span class="ruby-keyword kw">end</span>
</pre>
          </div>
        </div>
      </div>


    </div>


  </div>


<div id="validator-badges">
  <p><small><a href="http://validator.w3.org/check/referer">[Validate]</a></small></p>
</div>

</body>
</html>